package com.fql.research.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fql.research.sys.dao.UserDao;
import com.fql.research.sys.domain.User;
import com.fql.research.sys.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;

	@Override
	@Transactional(readOnly=true)
	public User selectUserById(Integer userId) {
		return userDao.selectUserById(userId);
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void updateUser(User user) {
		userDao.updateUser(user);
	}

	@Override
	public User getByUserName(String userName) {
		return userDao.getByUserName(userName);
	}
}
